﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="AddCategory.aspx.cs" Inherits="Admin_Default2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="top-bar select-bar">
        <h1>
            <b>Category</b></h1>
        <asp:Label ID="lblmsg" Font-Bold="true" Width="100%" runat="server" BackColor="GreenYellow"
            ForeColor="Black" EnableTheming="False"></asp:Label>
    </div>
    <br />
    <div class="table">
        <table>
            <tr>
                <td>
                    <asp:Label ID="lblAddCategory" Font-Bold="true" runat="server" Text="Add Category:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtAddCategory" runat="server" Width="150%"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td align="center">
                    <asp:Button ID="btnAddCategory" Font-Bold="true" Text="Add" runat="server" OnClick="btnAddCategory_Click" />
                </td>
            </tr>
        </table>
    </div>
    <div>
        <asp:GridView ID="grdCategory" Width="100%" GridLines="Horizontal" runat="server"
            AutoGenerateColumns="false" ShowHeader="true" DataKeyNames="CategoryID" OnRowCancelingEdit="grdCategory_RowCancelingEdit"
            OnRowEditing="grdCategory_RowEditing" OnRowUpdating="grdCategory_RowUpdating">
            <Columns>
                <asp:TemplateField HeaderText="ID">
                    <ItemTemplate>
                        <asp:Label ID="lblCategoryID" Font-Bold="true" Text='<%# DataBinder.Eval(Container.DataItem,"CategoryID")%>'
                            runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Category Name">
                    <ItemTemplate>
                        <asp:Label ID="lblCategoryName" Font-Bold="true" Text='<%# DataBinder.Eval(Container.DataItem,"CategoryName")%>'
                            runat="server"></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtCategoryName" Width="300px" BackColor="White" BorderStyle="Dotted"
                            BorderColor="Blue" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"CategoryName")%>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:CommandField ShowEditButton="True" />
            </Columns>
            <AlternatingRowStyle BackColor="Orange" />
            <HeaderStyle BackColor="SpringGreen" />
        </asp:GridView>
    </div>

</asp:Content>

